<p><strong>Changing the values here can have unforeseen or adverse effects. Please proceed with caution!</strong></p>

<?php if (hasPermission("namespaces.object.properties")): ?>
	<h4 id="properties">Properties</h4>
	
	<p>These options may change the way this object behaves or looks.</p>
	
	<?php if (count($properties)): ?>
		<form action="<?php echo Gene::makeLink($object) ?>/edit/advanced/properties#properties" method="post">
	
		<?php if($propertiessuccess): ?>
			<p class="success">Properties have been changed!</p>
		<?php elseif($propertieserror): ?>
			<p class="errormessage"><?php _e($propertieserror) ?></p>
		<?php endif; ?>
		
		<table>
		<tr><th>Property Name</th><th>Value</th><th></th></tr>
		<?php foreach ($properties as $i => $j): ?>
			<tr>
				<td><label for="properties[<?php _e($i) ?>]"><?php _e($i) ?></label></td>
				<td><textarea id="properties[<?php _e($i) ?>]" name="properties[<?php _e($i) ?>]" cols="40"><?php _e($j) ?></textarea></td>
				<td><label>Delete?<input type="checkbox" name="delete[]" value="<?php _e($i) ?>" /></label></td>
			</tr>
		<?php endforeach; ?>
		</table>
		
		<p><input type="submit" value="Save" /></p>
		
		</form>
	<?php endif; ?>
	
	<form action="<?php echo Gene::makeLink($object) ?>/edit/advanced/properties#properties" method="post">
		<input type="hidden" name="new" value="1" />
		<p><strong>Create New Property</strong></p>
		<p><label>Property Name:<br /><input type="text" name="propertyname" /></label></p>
		<p><label>Property Value:<br /><textarea name="propertyvalue" cols="40"></textarea></label></p>
		<p><input type="submit" value="Create Property" /></p>
	</form>
<?php endif; ?>

<?php if (hasPermission("namespaces.object.set_aliases")): ?>
	<form action="<?php echo Gene::makeLink($object) ?>/edit/advanced/alias#alias" method="post">
	
	<h4 id="alias">Alias</h4>
	
	<?php if ($aliassuccess): ?>
		<p class="success">Alias has been changed!</p>
	<?php elseif ($aliaserror): ?>
		<p class="errormessage">Alias has not been changed: <?php _e($aliaserror) ?></p>
	<?php endif; ?>
	
	<p>An alias can make it easier to access a page by giving it a more memorable URL. Aliases must be unique.</p>
	
	<p><strong>Alias:</strong>
	<input type="text" name="alias" value="<?php _e($object['alias']) ?>" />
	<input type="submit" value="Apply Alias" /></p>
	
	<p>URL: <?php echo Gene::makeLink('<strong>alias</strong>') ?></p>
	
	</form>
<?php endif; ?>

<?php if (hasPermission("namespaces.object.permissions")): ?>
	<form action="<?php echo Gene::makeLink($object) ?>/edit/advanced/permissions#permissions" method="post">
	
	<h4 id="permissions">Permissions</h4>
	
	<?php if ($permissionsuccess): ?>
		<p class="success">Permissions have been changed!</p>
	<?php endif; ?>
	
	<p>Permissions control who can access or manage the content of this page. This does not affect the permissions for any child objects.</p>
	
	<p><strong>View:</strong> <input type="text" name="p_view" value="<?php _e($object['p_view']) ?>" /></p>
	<p><strong>Edit:</strong> <input type="text" name="p_edit" value="<?php _e($object['p_edit']) ?>" /></p>
	<p><strong>Revisions:</strong> <input type="text" name="p_revisions" value="<?php _e($object['p_revisions']) ?>" /></p>
	<p><strong>Write:</strong> <input type="text" name="p_write" value="<?php _e($object['p_write']) ?>" /></p>
	<p><strong>Moderate:</strong> <input type="text" name="p_moderate" value="<?php _e($object['p_moderate']) ?>" /></p>
	
	<p><input type="submit" value="Save" /></p>
	
	</form>
<?php endif; ?>

<?php if (hasPermission("namespaces.object.change_owner")): ?>
	<form action="<?php echo Gene::makeLink($object) ?>/edit/advanced/owner#ownership" method="post">
	
	<h4 id="ownership">Ownership</h4>
	
	<?php if ($ownersuccess): ?>
		<p class="success">Owner has been changed!</p>
	<?php elseif ($ownererror): ?>
		<p class="errormessage">Owner has not been changed: <?php _e($ownererror) ?></p>
	<?php endif; ?>
	
	<p>This will transfer full editing and ownership rights to another user.</p>
	
	<p><strong>Ownership Public Name:</strong>
	<input type="text" name="name" value="<?php _e($ownername) ?>" />
	<input type="submit" value="Transfer ownership" /></p>
	
	</form>
<?php endif; ?>

